<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Installing Ant</title>
<link rel="stylesheet" type="text/css" href="stylesheets/antmanual.css">
</head>

<body>
<h1>Installing Dant</h1>
<h2><a name="getting">Getting Dant</a></h2>
<h3>Binary Edition</h3>
<p>The latest stable version of Dant is available from the <a href="http://dant.3322.org/node/8">Dant downloads page</a>.

Currently we didn't provide the CVS access due to the lack of machine and network resouces.</p>
<h3>Source Edition</h3>

<p>If you prefer the source edition, you can download the source for the latest Dant release from <a href="http://dant.3322.org/node/8">Dant downloads page</a>.</p>

<hr>
<h2><a name="sysrequirements">System Requirements</a></h2>
We tested Dant on two major platforms Linux and Windows.
<p>
To build and use Dant, you must have a JAXP-compliant XML parser installed and
available on your classpath.</p>
<p>This version of Dant require the Apache Ant 1.5.4 or above installed on your system. Enviroment ANT_HOME is required set properly. </p>
<p>For the current version of Dant, you will also need a JDK installed on
your system, version 1.2 or later.</p>
<p>
<strong>Note: </strong>The Microsoft JVM/JDK is not supported.
</p>
<p>
<strong>Note #2: </strong>If a JDK is not present, only the JRE runtime, then many tasks will not work.
</p>
<hr>
<h2><a name="installing">Installing Ant</a></h2>
<p>The binary distribution of Ant consists of the following directory layout:
<pre>
  dant
   +--- bin  // contains launcher scripts
   |
   +--- lib  // contains Dant jars plus necessary dependencies
   |
   +--- docs // contains documentation
   |      +--- api    // a brief description of ant2 requirements
   |      |
   |      +--- images  // various logos for html documentation
   |      |
   |      +--- manual  // Ant documentation (a must read ;-)
   |
   +--- testcases // contains example build files for unit test
   |
   +--- etc // contains xsl goodies to:
            //   - create an enhanced report from xml output of various tasks.
            //   - migrate your build files and get rid of 'deprecated' warning
            //   - ... and more ;-)
</pre>

Only the <code>bin</code> and <code>lib</code> directories are
required to run Ant.

To install Dant, choose a directory and copy the distribution
file there. This directory will be known as DANT_HOME.
</p>

<table width="80%">
<tr>
  <td colspan="2">
    <b>Windows 95, Windows 98 &amp; Windows ME Note:</b>
  </td>
</tr>
<tr>
  <td width="5%">&nbsp;</td>
  <td><i>
On these systems, the script used to launch Ant will have
problems if ANT_HOME is a long filename (i.e. a filename which is not
of the format known as &quot;8.3&quot;). This is due to
limitations in the OS's handling of the <code>&quot;for&quot;</code>
batch-file statement. It is recommended, therefore, that Ant be
installed in a <b>short</b>, 8.3 path, such as C:\Ant. </i>
  </td>
</tr>
<tr>
  <td width="5%">&nbsp;</td>
  <td>
    <p>On these systems you will also need to configure more environment
       space to cater for the environment variables used in the Ant lauch script.
       To do this, you will need to add or update the following line in
       the <code>config.sys</code> file
    </p>
    <p><code>shell=c:\command.com c:\ /p /e:32768</code></p>
  </td>
</tr>
</table>

<h3>Setup</h3>
<p>
Before you can run dant there is some additional set up you
will need to do:</p>
<ul>
<li>Add the <code>bin</code> directory to your path.</li>
<li>Set the <code>DANT_HOME</code> environment variable to the
directory where you installed Dant.  On some operating systems the ant
wrapper scripts can guess <code>DANT_HOME</code> (Unix dialects and
Windows NT/2000) - but it is better to not rely on this behavior.</li>
<li>Set the <code>ANT_HOME</code> environment variable
(see the <a href="#advanced">Advanced</a> section below).
This should be set to the directory where your ANT is installed.</li>
<li>Optionally, set the <code>JAVA_HOME</code> environment variable (see the <a href="#advanced">Advanced</a> section below). This should be set to the directory where your JDK is installed.</li>
</ul>
<p><strong>Note:</strong> Do not install Ant's ant.jar file into the lib/ext
directory of the JDK/JRE. Ant is an application, whilst the extension
directory is intended for JDK extensions. In particular there are security
restrictions on the classes which may be loaded by an extension.</p>

<h3>Windows and OS/2</h3>
<p>Assume Dant is installed in <code>c:\dant-1.5.4\</code>. The following sets up the
environment:</p>
<pre>set DANT_HOME=c:\dant-1.5.4
set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk1.2.2
set PATH=%PATH%;%ANT_HOME%\bin;%DANT_HOME%\bin</pre>

<h3>Unix (bash)</h3>
<p>Assume Dant is installed in <code>/usr/local/dant</code>. The following sets up
the environment:</p>
<pre>
export DANT_HOME=/usr/local/dant-1.5.4
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/jdk-1.2.2
export PATH=${PATH}:${ANT_HOME}/bin:${DANT_HOME}/bin</pre>

<h3><a name="advanced">Advanced</a></h3>



<p>There are lots of variants that can be used to run Ant. What you need is at
least the following:</p>
<ul>
<li>The classpath for Ant must contain <code>ant.jar</code> and any jars/classes
needed for your chosen JAXP-compliant XML parser.</li>
<li>When you need JDK functionality
(such as for the <a href="CoreTasks/javac.html">javac</a> task or the
<a href="CoreTasks/rmic.html">rmic</a> task), then for JDK 1.1, the <code>classes.zip</code>
file of the JDK must be added to the classpath; for JDK 1.2 or JDK 1.3, <code>tools.jar</code>
must be added. The scripts supplied with Ant,
in the <code>bin</code> directory, will add
the required JDK classes automatically, if the <code>JAVA_HOME</code>
environment variable is set.</li>

<li>When you are executing platform-specific applications, such as the
<a href="CoreTasks/exec.html">exec</a> task or the
<a href="CoreTasks/cvs.html">cvs</a> task, the property <code>ant.home</code>
must be set to the directory containing where you installed Ant. Again
this is set by the Ant scripts to the value of the ANT_HOME environment
variable.</li>
</ul>
The supplied ant shell scripts all support an <tt>ANT_OPTS</tt>
environment variable which can be used to supply extra options
to ant. Some of the scripts also read in an extra script stored
in the users home directory, which can be used to set such options. Look
at the source for your platform's invocation script for details.

<hr>
<h2><a name="buildingant">Building Dant</a></h2>
<p>To build Dant from source, you can either install the Dant source distribution
or checkout the Dant module from CVS.</p>
<p>Once you have installed the source, change into the installation
directory.</p>

<p>Set the <code>ANT_HOME</code> environment variable
to the directory where the Apache Ant is installed.</p>
<p>Set the <code>JAVA_HOME</code> environment variable to the directory where the JDK is installed.</p>
<p>Your are now ready to build Ant:</p>

<blockquote>
  <p><code>ant package </code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Windows</i>)</p>
  <p><code>ant package </code>&nbsp;&nbsp;&nbsp;&nbsp;(<i>Unix</i>)</p>
</blockquote>

<p>This will create a binary distribution of Dant in the directory $DANT_HOME/dist.</p>

<p>The above action does the following:</p>
<ul>

<li>It will build the source code, make a dant-${version}.jar , make a dant.war, build the java docs and package the binary version and package the source version.</li>
</ul>

<p>&nbsp;</p>
<hr>
<p align="center">Copyright &copy; 2005 Dant Organization. All rights Reserved.</p>

</body>
</html>

